package com.example.lin.day9_27.mvp.presenter;

import com.example.lin.day9_27.mvp.model.IShopModel;
import com.example.lin.day9_27.mvp.model.ShopModel;
import com.example.lin.day9_27.mvp.view.IShopView;

import java.util.List;

public class ShopPresenter implements IShopPresenter {

    private IShopModel model;
    private IShopView view;

    public ShopPresenter(IShopView view) {
        this.view = view;
        model = new ShopModel();
    }

    @Override
    public void getShopList(int pageNum, int pageSize) {
        model.getShopList(pageNum, pageSize, new IShopModel.OnShopCallback() {
            @Override
            public void onComplete(List<String> shops) {
                view.updateShopList(shops);
            }
        });
    }
}
